package com.learn._04mybatis.mapper;

import com.learn._04mybatis.pojo.Comment;
import com.learn._04mybatis.pojo.CommentVO1;
import com.learn._04mybatis.pojo.CommentVO2;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CommentMapper {
//    @Insert("insert into comment(content,created,weibo_id,user_id) values (#{content},#{created},#{weiboId},#{userId})")
    int insertComment(Comment comment);

//    @Delete("delete from comment where id = #{id}")
    int deleteCommentById(Integer id);

//   @Update("update comment set content = #{content},created = #{created},weibo_id= #{weiboId},user_id=#{userId} where id = #{id}")
    int updateComment(Comment comment);

//    @Select("select content,user_id userId from comment where id = #{id}")
    CommentVO1 selectCommentVO1ById(Integer id);

//    @Select("select id,content,user_id userId from comment where user_id = #{userId}")
    List<CommentVO2> selectCommentByUserId(Integer userId);

    int dynamicDeleteById(Integer[] ids);
}
